{extend name="template/base" /}
{block name="content"}
<style>
  .tops{margin-top:4%!important;}
  .styles{margin:0 auto;text-align:center;margin:3% 0;}
  .styles>div{ display:inline-block;}
  .styles label{width:50%;}
  input{border-radius:5px;}
 .styles input{width:80%;}
  .styles .formControls{width:15%;padding:0;}
</style>

<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl tops">
            <label class="form-label col-xs-3 col-sm-3">等级名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="rank_id">
                    {volist name="rank_list" id="rank"}
                    {if $vo.rank_id==$rank.id}
                    <option value="{$rank.id}" selected>{$rank.name}</option>
                    {else}
                    <option value="{$rank.id}">{$rank.name}</option>
                    {/if}
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">标题：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="标题" name="title" value="{$vo.title ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">总分：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="total_score" class="input-text" placeholder="总分" name="total_score" value="{$vo.total_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
      <div class="styles">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">判断题分数：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="pre_judge_score" class="input-text" placeholder="判断题分数" name="pre_judge_score" value="{$vo.pre_judge_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">判断题数量：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="judge_num" class="input-text" placeholder="判断题数量" name="judge_num" value="{$vo.judge_num ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">判断题总分：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="judge_score" class="input-text" placeholder="判断题总分" name="judge_score" value="{$vo.judge_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
      </div>
      <div class="styles">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">单选题分数：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="pre_radio_score" class="input-text" placeholder="单选题分数" name="pre_radio_score" value="{$vo.pre_radio_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">单选题数量：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="radio_num" class="input-text" placeholder="单选题数量" name="radio_num" value="{$vo.radio_num ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">单选题总分：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" id="radio_score" class="input-text" placeholder="单选题总分" name="radio_score" value="{$vo.radio_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
      </div>
      <div class="styles">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">多选题分数：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" id="pre_multi_score" placeholder="多选题分数" name="pre_multi_score" value="{$vo.pre_multi_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">多选题数量：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" id="multi_num" placeholder="多选题数量" name="multi_num" value="{$vo.multi_num ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">多选题总分：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text"  id="multi_score" placeholder="多选题总分" name="multi_score" value="{$vo.multi_score ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
      </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">限时（秒）：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="限时（秒）" name="time_limit" value="{$vo.time_limit ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("#pre_judge_score,#judge_num,#pre_radio_score,#radio_num,#pre_multi_score,#multi_num").change(function(){
            var judge_score=$('#pre_judge_score').val()*$('#judge_num').val();
            $("#judge_score").val(judge_score);
            var radio_score=$('#pre_radio_score').val()*$('#radio_num').val();
            $("#radio_score").val(radio_score);
            var multi_score=$('#pre_multi_score').val()*$('#multi_num').val();
            $("#multi_score").val(multi_score);
            $("#total_score").val(judge_score+radio_score+multi_score);
        });
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
